package com.nbsaas.boot.product.rest.convert;

import com.nbsaas.boot.product.data.entity.ProductCategory;
import com.nbsaas.boot.product.api.domain.request.ProductCategoryRequest;

import org.springframework.beans.BeanUtils;
import com.nbsaas.boot.rest.api.Converter;
import com.nbsaas.boot.utils.BeanDataUtils;

/**
* 商品分类请求对象转换成实体对象
*/

public class ProductCategoryEntityConvert  implements Converter<ProductCategory, ProductCategoryRequest> {

    @Override
    public ProductCategory convert(ProductCategoryRequest source) {
        ProductCategory result = new ProductCategory();
        BeanDataUtils.copyProperties(source, result);
        return result;
    }
}

